package com.modules.main;


import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.view.MenuItem;
import android.view.View;

import com.base.mvvm.MVVMBaseActivity;
import com.face.gaoml.netlibrary.widget.MsgAlert;
import com.gml.gao.R;
import com.gml.gao.databinding.MainActivityBinding;

import static com.gml.gao.R.id.videoView;


/**
 * MVPPlugin
 * 邮箱 784787081@qq.com
 */

public class MainActivity extends MVVMBaseActivity<MainActivityBinding, MainModle> {


    private MainActivityBinding binding;

    @Override
    public void initView() {
//        this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR);
        binding = DataBindingUtil.setContentView(this, R.layout.main_activity);
        binding.setHandler(this);
//        CustomVideoView mVv = (CustomVideoView) findViewById(videoView);
//添加播放控制条,还是自定义好点
//        MediaController mc = new MediaController(this);
////        mc.setVisibility(View.INVISIBLE);
//        mVv.setMediaController(mc);
//        // 播放在线视频
//        Uri mVideoUri = Uri.parse("http://v.jiemian.com/a3/a0/a3a0a20ad03506fe5bd18dd1166007cf_512.mp4");
//        mVv.setVideoPath(mVideoUri.toString());
//        mVv.seekTo(0);
////
//        mVv.requestFocus();
//        mVv.start();


    }

    @Override
    protected void handleToolBar(ToolBarHelper toolBarHelper) {

        toolBarHelper.setTitle("界面");
//        toolBarHelper.setHomeAsUpEnabled(true);
//        toolBarHelper.setLogo();
    }

    @Override
    protected void initInjector() {
//        DaggerMainComponet.builder()
//                .appComponent(getAppComponent())
//                .activityModule(getActivityModule())
//                .build()
//                .inject(this);
        ;
    }



    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        new MsgAlert().show("aaaa");
        return false;
    }

    @Override
    public ViewDataBinding getViewDataBinding() {
        return binding;
    }

    public void click(View view) {
        mPresenter.login("15901222696", "qqqqqqqq");
    }

}
